home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Sample Code / Snippets / Interapplication Communication / SmallDaemon / Faceless Background Apps README < prev    next >
Encoding:
Text File  |  1993-01-18  |  2.0 KB  |  20 lines  |  [TEXT/ttxt]

  1. Small Faceless Background Application
  2.  
  3. v1.0   7/92 Greg Robbins        based on code by C.K. Haun
  4.  
  5. This is a minimal faceless background application (FBA) for System 7. Versions are provided in MPW C and MPW Pascal.
  6.  
  7. It demonstrates how to install and dispatch Apple events, as well as the other bare essentials for a faceless background app.
  8.  
  9. The file type for the FBA should be 'APPL' if it will be launched like an application or 'appe' if it will be placed into the Extensions folder and launched at startup.  'appe' files can also have an INIT resource to put up an icon (using ShowInit) at startup.
  10.  
  11. Remember these things about FBAs:
  12.  
  13. • FBAs have only a 2K stack by default.  Increase the stack size with GetApplLimit/SetApplLimit when the FBA starts up if more stack space will be needed. Be sure the application partition is large enough to accomodate the enlarged stack. SetApplLimit enforces the default stack size as a minimum (24K under Color QuickDraw) so the partition should be large.
  14. • No interface is permitted in FBAs. Calls which might raise a dialog (for example, ResolveAlias or PPCBrowser) should not be made from within an FBA. FBA's can communicate with the user directly through the Notification Manager, or indirectly via Apple events or the PPC Toolbox.
  15. • FBAs should call InitGraf to initialize QuickDraw globals, but must not draw on the screen. InitWindows and InitMenus should not be called. For Think Pascal, be sure to disable auto-initialization with the {$I-} compiler option.
  16. • Unless the FBA needs periodic null event, set the sleep parameter to the WaitNextEvent call to a very large number. The FBA will then be woken only when necessary (like when a high-level event arrives, or when another program calls WakeUpProcess.)
  17. • The SIZE -1 resource should have the canBackground and backgroundOnly bits set.
  18. • Aside from the above restrictions, FBAs are normal Macintosh applications with their own heaps, A5 worlds, and the usual right, priveleges, and responsibilities of being a Mac application.
  19.  
  20.